import 'package:hotpot/generated/json/base/json_convert_content.dart';
import 'package:hotpot/models/sale_order_line.dart';

SaleOrderLine $SaleOrderLineFromJson(Map<String, dynamic> json) {
	final SaleOrderLine saleOrderLine = SaleOrderLine();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		saleOrderLine.id = id;
	}
	final List<String>? productId = jsonConvert.convertListNotNull<String>(json['product_id']);
	if (productId != null) {
		saleOrderLine.productId = productId;
	}
	final int? productUomQty = jsonConvert.convert<int>(json['product_uom_qty']);
	if (productUomQty != null) {
		saleOrderLine.productUomQty = productUomQty;
	}
	final double? priceUnit = jsonConvert.convert<double>(json['price_unit']);
	if (priceUnit != null) {
		saleOrderLine.priceUnit = priceUnit;
	}
	final double? priceTax = jsonConvert.convert<double>(json['price_tax']);
	if (priceTax != null) {
		saleOrderLine.priceTax = priceTax;
	}
	final double? priceTotal = jsonConvert.convert<double>(json['price_total']);
	if (priceTotal != null) {
		saleOrderLine.priceTotal = priceTotal;
	}
	return saleOrderLine;
}

Map<String, dynamic> $SaleOrderLineToJson(SaleOrderLine entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['product_id'] =  entity.productId;
	data['product_uom_qty'] = entity.productUomQty;
	data['price_unit'] = entity.priceUnit;
	data['price_tax'] = entity.priceTax;
	data['price_total'] = entity.priceTotal;
	return data;
}